/* Starter Board Resources for Bike_Display extension board:
 * Output Definitions:			
 *	OilTempLED1 (RED)		= PORTG.RG15
 *	OilTempLED2 (GREEN)		= PORTG.RG14
 *	OilTempLED3 (BLUE)		= PORTG.RG12
 *	BATLowLED (RED)			= PORTE.RE0
 *	NeutralLED (GREEN)		= PORTE.RE1
 *	LeftTurnLED (YELLOW)	= PORTE.RE2
 *	RightTurnLED (YELLOW)	= PORTE.RE3
 *	HighBeamLED (BLUE)		= PORTE.RE4
 *	CheckEngineLED (RED)	= PORTE.RE5
 *	OilPressureLED (RED)	= PORTE.RE6
 *	LowFuelLED (YELLOW)		= PORTE.RE7
 *	LightOnRelay			= PORTG.RG0
 *	I2CLEDEnable			= PORTD.RD11 - Active Low
 *	LCDReset				= PORTD.RD10 - Active Low
 *
 * Input Definitions:			
 *	Battery					= PORTB.RB0 - Analog AN0
 *	OilTemp					= PORTB.RB1 - Analog AN1
 *	Neutral					= PORTD.RD0
 *	LeftTurn				= PORTD.RD1
 *	RightTurn				= PORTD.RD2
 *	HighBeam				= PORTD.RD3
 *	CheckEngine				= PORTD.RD4
 *	OilPressure				= PORTD.RD5
 *	LowFuel					= PORTD.RD6
 *	SW1						= PORTD.RD6  (change notice pin CN15)
 *	SW2						= PORTD.RD7	 (change notice pin CN16)
 *	SW3						= PORTD.RD13 (change notice pin CN19)
 *
 * Debugger Definitions:			
 *			JTAG.TMS				= PORTA.RA0  (used by debugger)
 *			JTAG.TCK				= PORTA.RA1  (used by debugger)
 *			JTAG.TDO				= PORTA.RA5  (used by debugger)
 *			JTAG.TDI				= PORTA.RA4  (used by debugger)
 *			PGC2					= PORTB.RB6	 (used by debugger)
 *			PGD2					= PORTB.RB7  (used by debugger)
 */

#ifndef _BIKE_DISPLAY_HW_PROFILE_H_
#define _BIKE_DISPLAY_HW_PROFILE_H_

#ifdef __DEBUG
    #define MYDEBUG      printf    
#else
    #define MYDEBUG(ignore,...) ((void)0)
#endif

// Adds support for PIC32 Peripheral library functions and macros
#include <plib.h>

#define ARRAYSIZE   255
char ECMReceiveData[ARRAYSIZE];


#define SYS_CLOCK		(80000000UL)
#define GetSystemClock()            (SYS_CLOCK)
#define GetPeripheralClock()        (SYS_CLOCK)
#define GetInstructionClock()       (SYS_CLOCK)

// Bike_Display Output definitions
#define	OilTempLED1		BIT_15
#define	OilTempLED2		BIT_14
#define	OilTempLED3		BIT_12
#define	BATLowLED 		BIT_0
#define	NeutralLED 		BIT_1
#define	LeftTurnLED		BIT_2
#define	RightTurnLED	BIT_3
#define	HighBeamLED		BIT_4
#define	CheckEngineLED	BIT_5
#define	OilPressureLED	BIT_6
#define	LowFuelLED		BIT_7
#define	LightOnRelay	BIT_0
#define	I2CLEDEnable	BIT_11
#define	LCDReset		BIT_10

// Bike_Display Input definitions			
#define	BatteryIn		BIT_0
#define	OilTempIn		BIT_1
#define	NeutralIn		BIT_0
#define	LeftTurnIn		BIT_1
#define	RightTurnIn		BIT_2
#define	HighBeamIn		BIT_3
#define	CheckEngineIn	BIT_4
#define	OilPressureIn	BIT_5
#define	LowFuelIn		BIT_6


void IO_Startup_Config(void);
void I2C_Startup_Config (void);
void DelayMs(unsigned int);

#endif
